import React from 'react';
import AssignmentTurnedInOutlined from '@material-ui/icons/AssignmentTurnedInOutlined';
import { NavView, get_mod, loc, NavListSub } from 'sui';
import { OrderView, PickView } from './view';

const model = (cfg) => {
    const fix = [
        {uid: "warehouse.pick", view: PickView, value: loc("l_723")},
        {uid: "warehouse.order", view: OrderView, value: loc("l_781")},
    ];

    return get_mod(cfg, fix, "warehouse");
};

const WareHouse = ({ mod, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} name="warehouse"/>;

const NavWareHouse = (props) => <NavListSub icon={<AssignmentTurnedInOutlined/>} sub={model(props.cfg)} {...props} scut={15}/>;

export {NavWareHouse, WareHouse};
